const defaultStore = {
    loading:true,
    openOrders:[],
    closeOrders:[],
    index:0,
    openpage:1,
    closepage:1,
    openMore:0,
    cloaseMore:0,
    loading:false
}

export const TYPES = {
    LOADORDER:"order/loadorder",
    CHANGELOADING:"order/changeloading"
}

export default (store = defaultStore,action)=>{
    switch (action.type) {
        case TYPES.LOADORDER:
            return {
                ...store,
                openOrders:action.openOrders,
                closeOrders:action.closeOrders,
                loading:false,
                openpage:action.openpage,
                closepage:action.closepage
            }
        break;
        case TYPES.CHANGELOADING:
            return {
                ...store,
                loading:action.loading
            }
        break;
        default:
            return store;
            break;
    }
}